package com.finance.service.impl;


import com.finance.domain.Income;
import com.finance.service.IIncomeService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 收支Service业务层处理
 *
 * @author my
 * @date 2022-06-07
 */
@Service("incomeService")
public class IncomeServiceImpl extends BaseServiceImpl implements IIncomeService {

    /**
     * 查询收支
     *
     * @param id 收支ID
     * @return 收支
     */
    @Override
    public Income selectIncomeById(Integer id) {
        return incomeMapper.selectIncomeById(id);
    }

    /**
     * 查询收支列表
     *
     * @param income 收支
     * @return 收支
     */
    @Override
    public List<Income> selectIncomeList(Income income) {
        return incomeMapper.selectIncomeList(income);
    }

    /**
     * 新增收支
     *
     * @param income 收支
     * @return 结果
     */
    @Override
    public int insertIncome(Income income) {


        return incomeMapper.insertIncome(income);
    }

    /**
     * 修改收支
     *
     * @param income 收支
     * @return 结果
     */
    @Override
    public int updateIncome(Income income) {
        return incomeMapper.updateIncome(income);
    }


    /**
     * 删除收支信息
     *
     * @param id 收支ID
     * @return 结果
     */
    @Override
    public int deleteIncomeById(Integer id) {
        return incomeMapper.deleteIncomeById(id);
    }

    @Override
    public List<Integer> selectCurrentIn(String userId) {
        return incomeMapper.selectCurrentIn(userId);
    }

    @Override
    public List<Integer> selectCurrentOut(String userId) {
        return incomeMapper.selectCurrentOut(userId);
    }
}
